#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
	int money = 0;
	scanf("%d", &money);
	int s = money/1;
	int x = money;
	while (x >= 2 )
	{
		s += x / 2;
		x = x / 2 + x % 2;

	}
	printf("%d", s);

}